package com.cz.pay.service.impl;

import com.cz.pay.service.IPayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;

/**
 * <p>支付接口实现类</p>
 * <pre>
 * @author gitamacai
 * @date 2019/12/10 14:13
 * </pre>
 */
@Service
public class PayServiceImpl implements IPayService {
    @Autowired
    private JdbcTemplate jdbcTemplate;

    @Override
    public void reduce(String userId, int money) {
        jdbcTemplate.update("update account_tbl set money = money - ? where user_id = ?", new Object[]{money, userId});
    }
}
